$OpenBSD: patch-link-grammar_utilities_h,v 1.1 2017/05/27 16:54:57 espie Exp $

Index: link-grammar/utilities.h
--- link-grammar/utilities.h.orig
+++ link-grammar/utilities.h
@@ -189,20 +189,21 @@ int strncasecmp(const char *s1, const char *s2, size_t
    (Or in linux when I compile with -ansi) */
 #endif
 
-/* Cygwin < 2.6.0 doesn't have locale_t. */
-#ifdef HAVE_LOCALE_T
-locale_t newlocale_LC_CTYPE(const char *);
+// XXX horrible magic to get the stubs to shut things up
+#if defined(__clang__) && __has_include(<support/xlocale/__nop_locale_mgmt.h>)
+#include <cstddef>
+#include <support/xlocale/__nop_locale_mgmt.h>
 #else
-typedef int locale_t;
+typedef void *locale_t;
+#define freelocale(l)
+#endif
+
 #define iswupper_l(c, l) iswupper(c)
 #define iswalpha_l(c, l) iswalpha(c)
 #define iswdigit_l(c, l) iswdigit(c)
 #define iswspace_l(c, l) iswspace(c)
 #define towlower_l(c, l) towlower(c)
 #define towupper_l(c, l) towupper(c)
-#define freelocale(l)
-#endif /* HAVE_LOCALE_T */
-
 #define STR(x) #x
 #define STRINGIFY(x) STR(x)
 
